package com.pro.controller;

import com.pro.pojo.JsMenu;
import com.pro.pojo.JsonData;
import com.pro.service.JsMenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * ClassName:JsMenuController
 * Package:com.pro.controller
 * Description:
 *
 * @Date:2021/12/30 13:56
 * @Author: ZPT
 */
@RestController
@RequestMapping("menu")
public class JsMenuController {
    @Autowired
    private JsMenuService jsMenuService;

    @RequestMapping("/getMenu")
    public JsonData getMenu(Integer userId,Integer parentId){
        List<JsMenu> list = jsMenuService.getMenu(userId, parentId);
        return list!=null?JsonData.buildSuccess(list):JsonData.buildError("服务端错误");
    }
}
